<?php
namespace Core\Mvc\Entity;

use Core\Forms\Form;
/**
 * Interface EntityInterface
 * @package Core\Mvc\Entity
 * This class allows to access services in the services container by just only accessing a public property
 * with the same name of a registered service
 *
 * @property \Phalcon\Mvc\Dispatcher|\Phalcon\Mvc\DispatcherInterface $dispatcher
 * @property \Phalcon\Mvc\Router|\Phalcon\Mvc\RouterInterface $router
 * @property \Phalcon\Mvc\Url|\Phalcon\Mvc\UrlInterface $url
 * @property \Phalcon\Http\Request|\Phalcon\Http\RequestInterface $request
 * @property \Phalcon\Http\Response|\Phalcon\Http\ResponseInterface $response
 * @property \Phalcon\Http\Response\Cookies|\Phalcon\Http\Response\CookiesInterface $cookies
 * @property \Core\Security\User $user
 * @property \Core\Forms\Manager $form
 * @property \Phalcon\Http\Cookie $cookie
 * @property \Core\Mvc\View\Volt $volt
 * @property \Core\Filter $filter
 * @property \Phalcon\Flash\Direct $flash
 * @property \Phalcon\Flash\Session $flashSession
 * @property \Core\Config $config
 * @property \Core\Mvc\EntityManager $entityManager
 * @property \Phalcon\Session\Adapter\Files|\Phalcon\Session\Adapter|\Phalcon\Session\AdapterInterface $session
 * @property \Phalcon\Events\Manager|\Phalcon\Events\ManagerInterface $eventsManager
 * @property \Phalcon\Db\AdapterInterface $db
 * @property \Core\Security $security
 * @property \Phalcon\Crypt|\Phalcon\CryptInterface $crypt
 * @property \Phalcon\Tag $tag
 * @property \Phalcon\Escaper|\Phalcon\EscaperInterface $escaper
 * @property \Phalcon\Annotations\Adapter\Memory|\Phalcon\Annotations\Adapter $annotations
 * @property \Phalcon\Mvc\Model\Manager|\Phalcon\Mvc\Model\ManagerInterface $modelsManager
 * @property \Phalcon\Mvc\Model\MetaData\Memory|\Phalcon\Mvc\Model\MetadataInterface $modelsMetadata
 * @property \Phalcon\Mvc\Model\Transaction\Manager|\Phalcon\Mvc\Model\Transaction\ManagerInterface $transactionManager
 * @property \Core\Assets\Manager $assets
 * @property \Phalcon\Di|\Phalcon\DiInterface $di
 * @property \Phalcon\Session\Bag|\Phalcon\Session\BagInterface $persistent
 * @property \Core\Mvc\View $view
 * @property \Core\Forms\Form $_form
 */

interface EntityInterface
{
    /**
     * @return string
     */
    public function getId();

    /**
     * @return bool | null
     */
    public function getSaveState();

    /**
     * @return string
     */
    public function getEntity();

    /**
     * @return string
     */
    public function getTitle(): string;

    /**
     * @return \Core\Forms\Form | null
     */
    public function getForm();

    /**
     * @param \Core\Forms\Form $form
     * @return $this
     */
    public function setForm(Form $form);

    /**
     * @param string $contentModel
     * @return $this
     */
    public function setContentModel(string $contentModel);

    /**
     * @param $links
     * @return $this
     */
    public function setLinks(array $links);

    /**
     * @return array
     */
    public function getLinks();

    /**
     * @return string
     */
    public function getContentModel();

    /**
     * @param $module
     * @return $this
     */
    public function setModule(string $module);

    /**
     * @return string
     */
    public function getModule(): string ;

    /**
     * @param null $field
     * @return mixed
     */
    public function setField($field = null);

    /**
     * @return array
     */
    public function getField();

    /**
     * @return bool | \Core\Forms\Form
     */
    public function addForm();

    /**
     * @return bool | \Core\Forms\Form
     */
    public function editForm();

    /**
     * @return mixed
     */
    public function delete();

    /**
     * @return mixed
     */
    public function save();

    /**
     * @return mixed
     */
    public function toArray();

    /**
     * @param null | array $parameters
     * @return array
     */
    public static function find(array $parameters = null);

    /**
     * @param null | array $param
     * @return mixed
     */
    public static function findFirst(array $param = null);
}